//
//  VideosModel.m
//  QuicklyPlay
//
//  Created by 你的温柔是我唯一沉溺 on 15/11/1.
//  Copyright © 2015年 OPteam. All rights reserved.
//

#import "VideosModel.h"

@implementation VideosModel

//给bool一个初始值:
-(instancetype)init{
    self = [super init];
    if (self) {
        _isDianzan = NO;
    }
    return self;
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}


- (void)setValue:(id)value forKey:(NSString *)key {
    
    [super setValue:value forKey:key];
    
    if ([key isEqualToString:@"digs"]) {
        self.digs = [NSString stringWithFormat:@"%@", value];
    }
    if ([key isEqualToString:@"plays"]) {  
        self.plays = [NSString stringWithFormat:@"%@", value];
    }
    
    
}


-(void)encodeWithCoder:(NSCoder *)aCoder{
    
    
    [aCoder encodeObject:self.digs forKey:@"digs"];
    [aCoder encodeObject:self.html forKey:@"html"];
    [aCoder encodeObject:self.img_height forKey:@"img_height"];
    [aCoder encodeObject:self.img_url forKey:@"img_url"];
    [aCoder encodeObject:self.img_width forKey:@"img_width"];
    [aCoder encodeObject:self.is_popup forKey:@"is_popup"];
    [aCoder encodeObject:self.m3u8_url forKey:@"m3u8_url"];
    [aCoder encodeObject:self.org_url forKey:@"org_url"];
    [aCoder encodeObject:self.share_url forKey:@"share_url"];

    [aCoder encodeObject:self.title forKey:@"title"];
    [aCoder encodeObject:self.vid forKey:@"vid"];
    [aCoder encodeObject:self.web_url forKey:@"web_url"];
    [aCoder encodeObject:self.plays forKey:@"plays"];
    [aCoder encodeObject:self.pub_id forKey:@"pub_id"];
    [aCoder encodeObject:self.publish_time forKey:@"publish_time"];

    
}

-(instancetype)initWithCoder:(NSCoder *)aDecoder{
    
    self = [super init];
    if (self) {
        self.digs = [aDecoder decodeObjectForKey:@"digs"];
        self.html = [aDecoder decodeObjectForKey:@"html"];
        self.img_height = [aDecoder decodeObjectForKey:@"img_height"];
        self.img_url = [aDecoder decodeObjectForKey:@"img_url"];
        self.img_width = [aDecoder decodeObjectForKey:@"img_width"];
        self.is_popup = [aDecoder decodeObjectForKey:@"is_popup"];
        self.m3u8_url = [aDecoder decodeObjectForKey:@"m3u8_url"];
        self.org_url = [aDecoder decodeObjectForKey:@"org_url"];
        self.share_url = [aDecoder decodeObjectForKey:@"share_url"];
        self.title = [aDecoder decodeObjectForKey:@"title"];
        self.vid = [aDecoder decodeObjectForKey:@"vid"];
        self.web_url = [aDecoder decodeObjectForKey:@"web_url"];
        self.plays = [aDecoder decodeObjectForKey:@"plays"];
        self.pub_id = [aDecoder decodeObjectForKey:@"pub_id"];
        self.publish_time = [aDecoder decodeObjectForKey:@"publish_time"];
        
    }
    return self;
}


@end
